Rows: 77 Columns: 9
── Column specification ────────────────────────────────────────────────────────
Delimiter: ","
chr (1): sp
dbl (8): lma, ll, a_mass, r_mass, n_mass, p_mass, wd, sm
ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
# Function to plot abundance for top/bottom species based on a specific traitplot_abundance <-function(env, ab, species_list, title_list) {for (i inseq_along(species_list)) { p <- env %>%mutate(abund = ab[species_list[i], ]) %>%ggplot(aes(x = col -0.5, y = row -0.5, fill = abund)) +ggtitle(title_list[i]) +geom_raster() +geom_vline(xintercept =0:10) +geom_hline(yintercept =0:6)print(p) }}# Set rownames for abundance matrix `ab`rownames(ab) <- trait$sp